package com.buba.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.buba.mapper.PaymentRecordMapper;
import com.buba.service.PaymentRecordService;
import entity.salary.PaymentRecord;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author beisheng
 * @since 2023-03-21
 */
@Service
public class PaymentRecordServiceImpl extends ServiceImpl<PaymentRecordMapper, PaymentRecord> implements PaymentRecordService {

    @Resource
    private PaymentRecordMapper paymentRecordMapper;

    /* *
     * @Author: beisheng
     * @Descriprion: 根据人员ID查询当年所有缴纳记录
     * @Date: 2023/3/21 19:27
     * @Return: common.R
     * @Param: [map]
     */

    @Override
    public List<PaymentRecord> selPaymentRecord(Map<String, Object> map) {
        Integer accId = (Integer) map.get("accId");
        Date date = (Date) map.get("date");
        List<PaymentRecord> paymentRecords = paymentRecordMapper.selectList(new QueryWrapper<PaymentRecord>().eq("acc_id", accId).eq("create_time", date));
        return paymentRecords;
    }
}
